﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string Name = this.TextBox1.Text;
            string Pwd = this.TextBox2.Text;
            if (Name == "Tom" && Pwd == "123456")
            {
                Response.Write("<script>alert('Welcome " + Name + "')</script>");
                Response.Write("<script>window.location ='proDing.aspx'</script>");
            }
            if (Name!="Tom")
            {
                this.Label1.Text = "用户名不存在或不正确，请重试!";
                this.Label1.ForeColor=Color.Red;
            }
            if (Pwd!="123456")
            {
                this.Label2.Text = "密码不正确,请重新输入!";
                this.Label2.ForeColor = Color.Red;
                
            }
        }
    }
}